package reflect;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;

/**
 * 获取一个注解的参数
 */
public class ReflectDemo8 {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException {
        Class cls = Class.forName("reflect.Person");
        Method method = cls.getMethod("sayHello");
        AutoRunMethod an = method.getAnnotation(AutoRunMethod.class);
        int d = an.value();
        System.out.println("参数值:"+d);
    }
}
